package com.ie.cloud.payment.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.icbc.api.internal.util.fastjson.annotation.JSONField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * Created with FR
 *
 * @Author: DQ
 * @Date: 2025/03/03/15:14
 * @Description: 描述语句
 */
@Getter
@Setter
public class MerchantOrderRecordAdd {

    /**
     * 业务类型
     */
    @Schema(title = "bizType", description = "业务类型")
    @NotBlank(message = "业务类型不能为空,请选择ElectricityBill或者ChargingPile")
    private String bizType;

    /**
     * 业务编号
     */
    @Schema(title = "bizCode", description = "业务编号")
    @NotBlank(message = "业务编号不能为空")
    private String bizCode;

    /**
     * 应用ID
     */
    @Schema(title = "appId", description = "应用ID")
    @NotBlank(message = "应用ID不能为空")
    private String appId;

    /**
     * 创建时间
     */
    @Schema(title = "createdAt", description = "创建时间")
    @NotNull(message = "创建时间不能为空")
    @Past(message = "创建时间错误")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createdAt;

    /**
     * 创建时间时间戳，毫秒
     */
    @Schema(title = "createdAtTimestamp", description = "创建时间时间戳，毫秒")
    @NotNull(message = "创建时间时间戳不能为空")
    private Long createdAtTimestamp;

    /**
     * updated_at
     */
    @Schema(title = "updatedAt", description = "updated_at")
    @NotNull(message = "更新时间时间戳不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updatedAt;


    /**
     * 商户名称
     */
    @Schema(title = "mchName", description = "商户名称")
//    @NotNull(message = "商户名称不能为空")
    private String mchName = "新航城峰和（北京）能源有限公司";

    /**
     * 类型: 1-普通商户, 2-特约商户(服务商模式)
     */
    @Schema(title = "mchType", description = "类型: 1-普通商户, 2-特约商户(服务商模式)")
    private Byte mchType = Byte.valueOf("1");


    /**
     * 支付方式代码
     */
    @Schema(title = "wayCode", description = "支付方式代码")
//    @NotNull(message = "支付方式代码不能为空")
    private String wayCode = "GS_PHONE";

    /**
     * 支付金额,单位分
     */
    @Schema(title = "amount", description = "支付金额,单位分")
    @NotNull(message = "支付金额不能为空")
    private Long amount;

    /**
     * 商户手续费费率快照
     */
    @Schema(title = "mchFeeRate", description = "商户手续费费率快照")
    private BigDecimal mchFeeRate = BigDecimal.ZERO;

    /**
     * 商户手续费,单位分
     */
    @Schema(title = "mchFeeAmount", description = "商户手续费,单位分")
    private Long mchFeeAmount = 0L;

    /**
     * 三位货币代码,人民币:cny
     */
    @Schema(title = "currency", description = "三位货币代码,人民币:cny")
//    @NotNull(message = "三位货币代码不能为空")
    private String currency = "cny";


    /**
     * 客户端IP
     */
    @Schema(title = "clientIp", description = "客户端IP")
    private String clientIp;

    /**
     * 商品标题
     */
    @Schema(title = "subject", description = "商品标题")
    @NotNull(message = "商品标题不能为空")
    private String subject;

    /**
     * 商品描述信息
     */
    @Schema(title = "body", description = "商品描述信息")
    @NotNull(message = "商品描述信息不能为空")
    private String body;


    /**
     * 付款人id
     */
    private String userId;

    /**
     * 退款次数
     */
    @Schema(title = "refundTimes", description = "退款次数")
    private Integer refundTimes = 0;

    /**
     * 异步通知地址
     */
    @Schema(title = "notifyUrl", description = "异步通知地址")
    private String notifyUrl;


    @JSONField(
            name = "bill_caese_date"
    )
    @Schema(title = "billCaeseDate", description = "订单失效时间")
    private String billCaeseDate;




}
